'use strict'

class treelist{

  constructor (mdb) {
    this.mdb = mdb || null
  }

  async get () {
    try{
      let sql='select * from backimgs,tree,users where backimgs.backimgid=tree.backimgid and tree.treeid=users.uid' 
      let r=await this.mdb.query(sql)
      let result=r['rows']  
      return result

    }catch(e){
      return ('failed',400)
    }
  }
 
}

module.exports = treelist
